image_urls = [
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg",
    "https://so1.360tres.com/t0165f9b1a3dca6c254.jpg"

]

# HTML表格模板
html_template = """
<html>
<head>
    <style>
        table {{
            width: 100%;
            border-collapse: collapse;
        }}
        th, td {{
            border: 1px solid black;
            padding: 10px;
            text-align: center;
        }}
    </style>
</head>
<body>
    <table>
        <tr>
            <th>Image URL</th>
            <th>Image</th>
        </tr>
        {rows}
    </table>
</body>
</html>
"""

# 生成表格行
rows = ""
for url in image_urls:
    rows += f"<tr><td>{url}</td><td><img src='{url}' alt='Image' width='100' height='100'></td></tr>"

# 生成完整的HTML内容
html_content = html_template.format(rows=rows)

# 保存HTML文件
with open("images_with_urls.xlsx", "w") as file:
    file.write(html_content)

print("HTML file created successfully!")
